<?php
# includes
include_once("conf.inc.php");
include_once("class_Conection.php");

$conn = new conection();
$sql = "SELECT * FROM usuarios WHERE username='".$_POST['username']."' AND password='".$_POST['password']."'";
$conn->open_conn();
$conn->executeQuery($sql);
$conn->close_conn();


# the result of the sql execution
$reg = mysql_fetch_array($conn->result,MYSQL_ASSOC);
$total = mysql_num_rows($conn->result);

  session_start();
                            
  if ($total == 1){
    $_SESSION['is_successful_login'] = true;
    header ('location: admin.php');
  }else{
	$_SESSION['is_successful_login'] = false;
    header ('location: index.php?err=err');	
  }
   
    
   
?>
